package xhwl.insurance.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import xhwl.insurance.R;
import xhwl.retrofitrx.HttpManager;
import xhwl.retrofitrx.OnNextListener;

/**
 * Created by fuyi on 2017/9/18.
 */

public class SubmitFailureDialog extends Dialog {
    private Context context;
    private Window window;


    public SubmitFailureDialog(Context context) {
        super(context, R.style.DialogRound);
        this.context = context;

    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        window = getWindow();
        this.setContentView(R.layout.dialog_submitfailure);
        intView();

    }

    private void intView() {
        // 修改对话框显示的位置
        WindowManager.LayoutParams attributes = window.getAttributes();
        attributes.gravity = Gravity.CENTER_HORIZONTAL | Gravity.CENTER_HORIZONTAL;//中心_水平
        window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
        attributes.alpha = 0.9f;//透明度
        attributes.dimAmount = 0.0f;//黑暗度
        WindowManager m = window.getWindowManager();
        Display d = m.getDefaultDisplay(); // 为获取屏幕宽、高
        WindowManager.LayoutParams p = getWindow().getAttributes(); // 获取对话框当前的参值
        p.height = (int) (d.getHeight() * 0.25);
        p.width = (int) (d.getWidth() * 0.65);
        getWindow().setAttributes(p); // 设置生效


    }

}
